package com.qianli.cashmama.trade.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.qianli.cashmama.trade.dao.TRiskInfoDao;
import com.qianli.cashmama.trade.entity.TRiskInfoEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: sm
 * Date: 2017-07-21
 * Time: 09:10:21.143
 */

@Repository
public class TRiskInfoDaoImpl extends AbstractBaseMapper<TRiskInfoEntity> implements TRiskInfoDao {
    @Override
    public List<TRiskInfoEntity> selectListByTradeNo(String tradeNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);
        return getSqlSession().selectList(getStatement("selectListByTradeNo"), map);
    }

    @Override
    public Integer updateByTradeNoAndType(TRiskInfoEntity tRiskInfoEntity) {
        return getSqlSession().update(getStatement("updateByTradeNoAndType"), tRiskInfoEntity);
    }

    @Override
    public TRiskInfoEntity selectOneByTradeNoAndType(String tradeNo, int type) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);
        map.put("type", type);

        return getSqlSession().selectOne(getStatement("selectOneByTradeNoAndType"), map);
    }
}